<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>dosen</title>
    <script src="../static/js/jquery-3.3.1.js"></script>
    <script src="../static/js/request-def.js"></script>
    <script src="../static/js/vue.js"></script>
    <link rel="stylesheet" href="../static/js/element-ui/lib/theme-chalk/index.css">
    <script src="../static/js/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
    <div align="center">
        <img src="../static/img/thought.jpg" height="300" width="1900"/>
    </div>
    <div id="bbb">
        <h1><span id="dosen-thought">dosen-thought</span> | <span id="thoughtMr"><a target="_blank"
                                                                                    href="chrome://net-export/#">思想者</a></span>
            | <span id="baidu"><a target="_blank" href="https://www.baidu.com">百度</a></span></h1>
        <h2><span id="consciousness" onclick="aaa()">consciousness</span> | <span id="thought">thought</span></h2>
    </div>
    <div id="aaa">
        <input id="results">
        <span id="s111"></span>
        <span id="s222"></span>
    </div>
    <input type="text" v-model="num">
    <button v-on:click="num++">点赞</button>
    <button v-on:click="cancle()">取消</button>
    <h1>{{name}},点赞数{{num}}</h1>
</div>
</body>
<script>

    let vm = new Vue({
        el: "#app",
        data: {
            name: "zhangsan",
            num: 100
        },
        methods: {
            cancle() {
                this.num--;
            }
        }
    });


    function aaa() {
        /**
         * Argument type [string] is not assignable to parameter type Node | string
         */
        get("/thought/cmp/k8s/cm")
            .then((data) => {
                console.log("查询结果: ", data);
                console.log(data.result);
                // let html = "<div align='center'> " + data.result + " </div>";
                // document.write(html);
                document.getElementById("results").value = data.result;
                document.getElementById("s111").innerHTML = "<div align='center'> " + data.result + " </div>";
                document.getElementById("s222").innerText = "<div align='center'> " + data.result + " </div>";
            });
    }
</script>
</html>
